package com.ia.aistream.service.operating.impl;

import java.util.List;
import com.ia.aistream.common.utils.DateUtils;
import com.ia.aistream.mapper.operating.DocAppendixMapper;
import com.ia.aistream.model.operating.entity.DocAppendix;
import com.ia.aistream.service.operating.IDocAppendixService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ia.aistream.common.core.text.Convert;

/**
 * 附录信息表Service业务层处理
 * 
 * @author aistream
 * @date 2021-01-25
 */
@Service
public class DocAppendixServiceImpl implements IDocAppendixService
{
    @Autowired
    private DocAppendixMapper docAppendixMapper;

    /**
     * 查询附录信息表
     * 
     * @param id 附录信息表ID
     * @return 附录信息表
     */
    @Override
    public DocAppendix selectDocAppendixById(Long id)
    {
        return docAppendixMapper.selectDocAppendixById(id);
    }

    /**
     * 查询附录信息表列表
     * 
     * @param docAppendix 附录信息表
     * @return 附录信息表
     */
    @Override
    public List<DocAppendix> selectDocAppendixList(DocAppendix docAppendix)
    {
        return docAppendixMapper.selectDocAppendixList(docAppendix);
    }

    /**
     * 新增附录信息表
     * 
     * @param docAppendix 附录信息表
     * @return 结果
     */
    @Override
    public int insertDocAppendix(DocAppendix docAppendix)
    {
        docAppendix.setCreateTime(DateUtils.getNowDate());
        return docAppendixMapper.insertDocAppendix(docAppendix);
    }

    /**
     * 修改附录信息表
     * 
     * @param docAppendix 附录信息表
     * @return 结果
     */
    @Override
    public int updateDocAppendix(DocAppendix docAppendix)
    {
        docAppendix.setUpdateTime(DateUtils.getNowDate());
        return docAppendixMapper.updateDocAppendix(docAppendix);
    }

    /**
     * 删除附录信息表对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteDocAppendixByIds(String ids)
    {
        return docAppendixMapper.deleteDocAppendixByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除附录信息表信息
     * 
     * @param id 附录信息表ID
     * @return 结果
     */
    @Override
    public int deleteDocAppendixById(Long id)
    {
        return docAppendixMapper.deleteDocAppendixById(id);
    }
}
